package com.macro.mall.portal.service.impl;

import com.github.pagehelper.PageHelper;
import com.macro.mall.mapper.BmsImportantActivitiesSlideshowMapper;
import com.macro.mall.model.BmsImportantActivitiesSlideshow;
import com.macro.mall.portal.dto.BmsImportantActivitiesSlideshowParam;
import com.macro.mall.portal.service.BmsImportantActivitiesSlideshowService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;
import java.util.List;


/**
 * 观光车点位图片Service实现类
 * Created by macro on 2018/4/26.
 */
@Service
public class BmsImportantActivitiesSlideshowServiceImpl implements BmsImportantActivitiesSlideshowService {
    @Autowired
    private BmsImportantActivitiesSlideshowMapper bmsImportantActivitiesSlideshowMapper;


    /**
     * 分页查询展览活动
     * @return
     */
    @Transactional
    @Override
    public List<BmsImportantActivitiesSlideshow> getList(BmsImportantActivitiesSlideshowParam bmsImportantActivitiesSlideshowParam) {
        PageHelper.startPage(bmsImportantActivitiesSlideshowParam.getPageNum(), bmsImportantActivitiesSlideshowParam.getPageSize());;
        BmsImportantActivitiesSlideshow bmsImportantActivitiesSlideshow = new BmsImportantActivitiesSlideshow();
        BeanUtils.copyProperties(bmsImportantActivitiesSlideshowParam, bmsImportantActivitiesSlideshow);

        List<BmsImportantActivitiesSlideshow> list = bmsImportantActivitiesSlideshowMapper.selectAll(bmsImportantActivitiesSlideshow);
        return list;
    }

    /**
     * 获取展览活动信息
     * @param id
     * @return
     */
    @Override
    public BmsImportantActivitiesSlideshow getItem(Long id) {
        return bmsImportantActivitiesSlideshowMapper.selectById(id);
    }


}
